import {
  Body,
  Controller,
  Req,
  Post,
  ClassSerializerInterceptor,
  UseInterceptors,
  UseGuards
} from '@nestjs/common'
import { ApiTags } from '@nestjs/swagger'
import { LoginDto } from './dto/auth-login.dto'
import {} from './local.strategy'
import { AuthGuard } from '@nestjs/passport'

@ApiTags('验证')
@Controller('auth')
export class AuthController {
  @UseGuards(AuthGuard('local'))
  @UseInterceptors(ClassSerializerInterceptor)
  @Post('login')
  login(@Body() user: LoginDto, @Req() req) {
    // req.user 是
    return req.user
  }
}
